////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Copyright (c) Microsoft Corporation.  All rights reserved.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////
// Portions Copyright (c) 2010-2011 Kentaro Sekimoto  All rights reserved.
////////////////////////////////////////////////////////////////////////////

#include <tinyhal.h>

#if defined(ADS_LINKER_BUG__NOT_ALL_UNUSED_VARIABLES_ARE_REMOVED)
#pragma arm section rwdata = "g_AvailableFSInterfaces"
#endif

extern FILESYSTEM_DRIVER_INTERFACE g_FAT32_FILE_SYSTEM_DriverInterface;
extern STREAM_DRIVER_INTERFACE g_FAT32_STREAM_DriverInterface;
//extern struct BlockStorageDevice g_KS_MB9BF568_USB_Device;
//FileSystemVolume g_KS_MB9BF568_USB_FS;


//#ifdef KS_MB9BF568_SERIAL_FLASH
extern struct BlockStorageDevice  g_KS_MB9BF568_BS;
FileSystemVolume g_KS_MB9BF568_NOR_FS;

//#else
//extern struct BlockStorageDevice g_SerialFlash_Device;
//FileSystemVolume g_KS_MB9BF568_SERIAL_FS;

//#endif

extern struct BlockStorageDevice  g_SD_BS;
FileSystemVolume g_SD_FS;
extern struct SD_BL_CONFIGURATION g_SD_BL_Config;

void FS_AddVolumes()
{
//#ifdef KS_MB9BF568_SERIAL_FLASH
//    FileSystemVolumeList::AddVolume( &g_KS_MB9BF568_NOR_FS, "ROOT", 0, 0, &g_FAT32_STREAM_DriverInterface, &g_FAT32_FILE_SYSTEM_DriverInterface, &g_KS_MB9BF568_BS, 1, FALSE );
//#else
//    FileSystemVolumeList::AddVolume( &g_KS_MB9BF568_SERIAL_FS, "ROOT", 0, 0, &g_FAT32_STREAM_DriverInterface, &g_FAT32_FILE_SYSTEM_DriverInterface, &g_SerialFlash_Device, 1, FALSE );
//#endif
//    FileSystemVolumeList::AddVolume( &g_KS_MB9BF568_USB_FS, "U", 0, 0, &g_FAT32_STREAM_DriverInterface, &g_FAT32_FILE_SYSTEM_DriverInterface, &g_KS_MB9BF568_USB_Device, 1, FALSE );
//    FileSystemVolumeList::AddVolume( &g_SD_FS, "SD", 0, 0, &g_FAT32_STREAM_DriverInterface, &g_FAT32_FILE_SYSTEM_DriverInterface, &g_SD_BS, 0, FALSE );
}

void FS_MountRemovableVolumes()
{
}

FILESYSTEM_INTERFACES g_AvailableFSInterfaces[] =
{
    { &g_FAT32_FILE_SYSTEM_DriverInterface, &g_FAT32_STREAM_DriverInterface },
};

//const size_t g_InstalledFSCount = ARRAYSIZE(g_AvailableFSInterfaces);
const size_t g_InstalledFSCount = 1;

#if defined(ADS_LINKER_BUG__NOT_ALL_UNUSED_VARIABLES_ARE_REMOVED)
#pragma arm section rwdata
#endif
